package org.tomcat.unit501;

public final class Bootstrap {

    public static void main(String[] args) {
        HttpConnector connector = new HttpConnector();
        SimpleWrapper wrapper = new SimpleWrapper();
        wrapper.setServletClass("org.tomcat.unit501.PrimitiveServlet");
        Loader loader = new SimpleLoader();
        wrapper.setLoader(loader);
        connector.setContainer(wrapper);
        Valve valve1 = new ClientIPLoggerValve();
        Valve valve2 = new HeaderLoggerValve();
        wrapper.addValve(valve1);
        wrapper.addValve(valve2);
        try {
            connector.initialize();
            connector.start();

            System.in.read();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
